{{#need group parameter}}

{{extend "layout.html"}}
{{block menu}}
{{include "menu.html"}}
{{menu('group')}}
{{end}}

{{block content}}
<div class="content">
    <div class="menu">
        <img src="{{=group.get_icon_url(small=True)}}" class="home" style="margin-left:30px;"/>
        <ul>
            {{block group_menu}}
                {{include "group_menu.html"}}
                {{group_menu(group.name, current="dashboard")}}
            {{end}}
        </ul>
        <div class="clear"></div>
    </div>
    <div class="group_content">
        <div class="group_info">
            <div style="margin:10px">
                <span class="group_title">{{=group.caption}}</span> <span class="group_date">Created at: {{=group.create_time.strftime("%Y-%m-%d")}}</span>
            </div>
            <div>
                {{=group.description}}
            </div>
            <div class="group_tool">
                {{if has_role('trusted', request.user):}}
                    {{if has_permission('GroupJoin', request.user, group_name=group.name) and not has_role('group_member', request.user, group_name=group.name):}}
                        <a class="more-link red" href="/group/{{=group.name}}/join">Join</a>
                    {{else:}}
                        <a class="more-link red" href="/group/{{=group.name}}/leave">Leave</a>
                    {{pass}}
                {{else:}}
                    <span class="right">You've not signed in yet.</span>
                {{pass}}
                {{if has_permission('GroupEdit', request.user, group_name=group.name):}}
                    <a class="more-link red" href="/group/{{=group.name}}/edit">Edit</a>
                {{pass}}
                {{if has_permission('GroupEdit', request.user, group_name=group.name):}}
                    <a class="more-link red" href="/group/{{=group.name}}/delete">Delete</a>
                {{pass}}
            </div>
        </div>
        {{block group_content_container}}
            <!-- Conent of group -->
            <table border="0" cellspacing="10px" cellpadding="4px">
                <tr>
                    <td width="70%">
                    {{block group_nav}}
                        <!-- <div class="nav">
                            <a href="/group/{{=group.name}}">{{=group.caption}}</a>
                        </div>  -->
                    {{end}}
                    <div class="clearfix" style="margin:10px;">
                        {{block group_content}}
                        {{end}}
                    </div>
                    </td>
                    <td width="30%">
                        {{block group_sidebar}}
                        {{end}}
                    </td>
                </tr>
            </table>
        {{end}}
    </div>
</div>
{{end}}
